home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.6 KB | 64 lines | [TEXT/ttxt] |
- --<<<
-
- -- Create the boundary for the pages
- pageRect := new Rect x2:300 y2:360
-
- -- Create a line to appear across the top of each page.
- theLine := new twoDshape boundary:(new line x1:0 x2:300 y1:0 y2:0)
- theLine.stroke := new brush color:redcolor
-
- -- Position the line near the top of the page
- theLine.y := 50
-
- -- Create a text box to hold the page number appear on each page.
- textBounds := new Rect x2:50 y2:20
- pageNumberBox := new TextPresenter boundary:textBounds \
- target:("" as Text)
- pageNumberElement := new PageElement \
- presenter:pageNumberBox target:(e -> getParentData e Page)
-
- -- Center the page number element near the bottom of the page
- pageNumberElement.x := 250
- pageNumberElement.y := 30
-
- -- Create a page layer and make its outline be blue
- layer1 := new PageLayer boundary:pageRect
- layer1.stroke := new brush color:bluecolor
-
-
- -- append the line and the page number box to the page layer
- append layer1 pageNumberElement
- append layer1 theLine
-
- -- Create a document and append two pages to it
- theDocument := new Document
-
- page1 := new Page boundary:pageRect \
- frame:layer1 target:("Page 1" as text)
-
- page2 := new Page boundary:pageRect \
- frame:layer1 target:("Page 2" as text)
-
- append theDocument page1
- append theDocument page2
-
- -- Create a window that is slightly bigger than the first
- -- page in the document.
-
- w := new window
- w.fill := whitebrush
- w.height := page1.boundary.height + 50
- w.width := page1.boundary.width + 50
-
- show w
-
- -- Append the document to the window.
- -- Center the document in the window.
- append w theDocument
- theDocument.x := 25
- theDocument.y := 25
-
- -- Open the second page
- goto theDocument 2
- -->>>
-